﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once

#include "IEvent.h"

namespace gcmp
{
    class IModelView;
    class IModelViewEventHandler;

    /// \brief 模型视图事件
    ///
    class IModelViewEvent : public IEvent
    {
        DEFINE_CAST_DERIVED(gcmp::IModelViewEvent, gcmp::IEvent);
    public:

        ///  \brief 添加模型视图事件处理者
        ///
        /// \param  pHandler 模型视图事件处理者
        /// \return 添加成功返回true，否则返回失败
        virtual bool Add(IModelViewEventHandler* pHandler) = 0;

        ///  \brief 删除模型视图事件处理者
        ///
        /// \param  pHandler 模型视图事件处理者
        /// \return 删除成功返回true，否则返回失败
        virtual bool Delete(IModelViewEventHandler* pHandler) = 0;

        ///  \brief 获取模型视图事件发送者
        ///
        /// \return 模型视图
        virtual IModelView* GetSender() const = 0;
    };
}
